32. TensorFlow Convolutional Layer Workspaces

### Using Convolution Layers in TensorFlow

Let's now apply what we've learned to build real CNNs in TensorFlow. In the below exercise, you'll be asked to set up the dimensions of the Convolution filters, the weights, the biases. This is in many ways the trickiest part to using CNNs in TensorFlow. Once you have a sense of how to set up the dimensions of these attributes, applying CNNs will be far more straight forward.

Review

You should go over the TensorFlow documentation for 2D convolutions . Most of the documentation is straightforward, except perhaps the padding argument. The padding might differ depending on whether you pass 'VALID' or 'SAME' .

Here are a few more things worth reviewing:

  1. Introduction to TensorFlow -> TensorFlow Variables .
  2. How to determine the dimensions of the output based on the input size and the filter size (shown below). You'll use this to determine what the size of your filter should be.
    new_height = (input_height - filter_height + 2 * P)/S + 1 new_width = (input_width - filter_width + 2 * P)/S + 1

Instructions

  1. Finish off each TODO in the conv2d function.
  2. Setup the strides , padding and filter weight/bias ( F_w and F_b ) such that
    the output shape is (1, 2, 2, 3) . Note that all of these except strides should be TensorFlow variables.

Workspace

This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity , so you may be able to download them there.

Workspace Information:

  • Default file path:
  • Workspace type: jupyter
  • Opened files (when workspace is loaded): n/a